Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor limit, offset #3120

Merged
merged 1 commit into from
Sep 12, 2024
Merged

Refactor limit, offset #3120

merged 1 commit into from
Sep 12, 2024

Conversation

dstepanov
Copy link
Contributor

For MongoDB we don't need to store limit, offset in the metadata for the runtime.
For JBDC we can generate the SQL query directly if there is no runtime sorting.

@dstepanov dstepanov added the type: improvement A minor improvement to an existing feature label Sep 12, 2024
*/
@Deprecated(forRemoval = true, since = "4.10")
String META_MEMBER_PAGE_SIZE = "pageSize";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old members are confusing, page size / index are always limit / offset

@@ -434,30 +436,63 @@ protected <RT> Optional<RT> getParameterInRole(MethodInvocationContext<?, ?> con
*/
@NonNull
protected Pageable getPageable(MethodInvocationContext<?, ?> context) {
Pageable pageable = getParameterInRole(context, TypeRole.PAGEABLE, Pageable.class).orElse(null);
Pageable pageable = getPageableInRole(context);
if (pageable == null) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is confusing, we never store direct page index / size into metadata. Offset is never using in the implementation

Copy link

sonarcloud bot commented Sep 12, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
2 New Critical Issues (required ≤ 0)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@dstepanov dstepanov merged commit dbad603 into 4.10.x Sep 12, 2024
52 of 53 checks passed
@dstepanov dstepanov deleted the pag branch September 12, 2024 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: improvement A minor improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants